Fix an issue for passing arguement from control panel to deivce model
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Sun, 23 Oct 2005 15:51:47 +0000 (16:51 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Sun, 23 Oct 2005 15:51:47 +0000 (16:51 +0100)
for some arguemnt like 'localtime', 'isa', device model need an argument
"-localtime", instead of "-localtime 1"
Signed-off-by: Xiaofeng Ling <xiaofeng.ling@intel.com>
tools/python/xen/xend/image.py

index ee57bba5daee32f0b0269ddc158cb4a32f0a2c72..6cd9f540f396a69455a571090b10d28272ffd12b 100644 (file)
@@ -243,11 +243,12 @@ class VmxImageHandler(ImageHandler):
             # Handle booleans gracefully
             if a in ['localtime', 'std-vga', 'isa', 'nic-ne2000']:
                 if v != None: v = int(v)
-
+                if v: ret.append("-%s" % a)
+            else:
+                if v:
+                    ret.append("-%s" % a)
+                    ret.append("%s" % v)
             log.debug("args: %s, val: %s" % (a,v))
-            if v: 
-                ret.append("-%s" % a)
-                ret.append("%s" % v)
 
         # Handle disk/network related options
         for (name, info) in deviceConfig: